-- Licensed under the Apache License, Version 2.0 (the "License");
-- You may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--     http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- Copyright (C) 2022-2023 RT-Thread Development Team
--
-- @author      xqyjlj  
-- @file        arm-linux-gnueabihf.lua
--
-- Change Logs:
-- Date           Author       Notes
-- ------------   ----------   -----------------------------------------------
-- 2023-03-10     xqyjlj       initial version
--
set_xmakever("2.7.2")

toolchain("arm-linux-gnueabihf") -- add toolchain
do
    set_kind("cross") -- set toolchain kind
    set_description("arm embedded compiler for linux")
    
    on_check(function (toolchain)
        return import("lib.detect.find_tool")("arm-none-linux-gnueabihf-gcc")
    end)

    on_load(function(toolchain)
        toolchain:set("toolset", "cc", "arm-none-linux-gnueabihf-gcc")
        toolchain:set("toolset", "cxx", "arm-none-linux-gnueabihf-g++")
        toolchain:set("toolset", "ld", "arm-none-linux-gnueabihf-gcc")
        toolchain:set("toolset", "ar", "arm-none-linux-gnueabihf-ar")
        toolchain:set("toolset", "ex", "arm-none-linux-gnueabihf-ar")
        toolchain:set("toolset", "strip", "arm-none-linux-gnueabihf-strip")
        toolchain:set("toolset", "as", "arm-none-linux-gnueabihf-as")
        toolchain:set("toolset", "nm", "arm-none-linux-gnueabihf-nm")
        toolchain:set("toolset", "objcopy", "arm-none-linux-gnueabihf-objcopy")
        toolchain:set("toolset", "objdump", "arm-none-linux-gnueabihf-objdump")
    end)
end
toolchain_end()
